<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::model('projects', 'projects');
Route::get('/', function () {
    if (Auth::check()) {
        return Redirect::to('/home');
    } else {
        return Redirect::to('/welcome');
    }
});
Route::get('/logout', function () {
    Auth::logout();
    return Redirect::to('/home');
});
Route::get('/jlogout', function () {
    Auth::logout();
	return "true";
});
Route::get('/help', 'projectsController@help');


Route::get('/train/callback', 'trainController@callbackkuibu');
Route::get('/train/suggest', 'trainController@sug');  # xss
Route::get('/train/suggest2', 'trainController@sug2');  # xss 2
Route::get('/train/heredity', 'trainController@heredity');
Route::get('/train/gatool', 'trainController@gatools');
Route::get('/train/heredity/checkuser', 'trainController@checkuser');
Route::get('/train/heredity/check', 'trainController@checkheredity');
Route::get('/train/qlla', 'trainController@qlla');
Route::get('/train/abtest', 'trainController@abtest');
Route::get('/train/qllb', 'trainController@qllb');
Route::get('/train/qllv1', 'trainController@qllv1');
Route::get('/train/qllt', 'trainController@qllt');
Route::get('/train/spider3/{id}', 'trainController@spider3');
Route::get('/train/register', 'trainController@register');
Route::get('/train/proxy', 'trainController@proxy');
Route::get('/train/plus', 'trainController@plus');
Route::get('/train/handsomerank', 'trainController@spamrank');
Route::get('/train/cr', 'trainController@cr');
Route::get('/train/modulo', 'trainController@modulo');
Route::get('/train/autocr', 'trainController@autocr');
Route::post('/train/autocr', 'trainController@autocr');
Route::get('/train/automodu', 'trainController@automodu');
Route::post('/train/autocr', 'trainController@autocr');
Route::get('/train/crcheck', 'trainController@crcheck');
Route::get('/train/moducheck', 'trainController@moducheck');
Route::post('/train/crcheck', 'trainController@crcheck');
Route::post('/train/handsomerank', 'trainController@spamrank');

Route::get('/inbox', 'UsersController@inbox');
Route::get('/inbox/{senderid?}/{receiverid?}', 'UsersController@inbox');
Route::get('/task/{id}/showlog', 'TasksController@showlog');


Route::group(['middleware' => ['admin']], function () {
    Route::get('/admin/sender', 'AdminController@sender');
    Route::post('/admin/sender', 'AdminController@sender');
    Route::get('/admin', 'AdminController@index');

    Route::get('/admin/u2i/{id}', 'AdminController@url2id');
    Route::get('/admin/i2u/{id}', 'AdminController@id2url');

//学习资料审核后天
    Route::get('admin/taskpass', 'AdminController@taskpass');
//勋章发放后天
    Route::get('admin/medalgrant', 'AdminController@medalgrant');

    //article
//

});


Route::get('/admin/upstudy', 'AdminController@upstudy');
Route::get('/article/{tag}/{types?}', 'artController@articles');
Route::get('/info/{tag}/article/{types?}', 'artController@articles');
Route::post('/genart/{tag?}', 'artController@create');
Route::get('/genart/{tag?}', 'artController@create');
Route::get('/admin/del', 'comController@del');
Route::get('/task/vote', 'TasksController@vote');
Route::post('/task/vote', 'TasksController@vote');
Route::post('/task/studycomment', 'TasksController@studycomment');
Route::get('/task/setcontenttype', 'TasksController@setcontenttype');

Route::get('/welcome', 'welController@welcome');
Route::get('/rank', 'welController@rank');
Route::get('/log', 'welController@log');
Route::get('/download/{file}', 'welController@download');
//
Route::get('/link', 'projectsController@link');
Route::get('/u/update', 'UsersController@index');
Route::post('/u/update', 'UsersController@index');
Route::post('/u/store', 'UsersController@store');
Route::post('/link', 'projectsController@link');
//
Route::get('task/move', 'TasksController@move');
Route::get('task/create', 'TasksController@create');
Route::post('task/store', 'TasksController@store');
Route::post('task/move', 'TasksController@move');
//学习资料审核
Route::get('task/checkcontent', 'TasksController@checkcontent');
//个人中心route
Route::get('api/user/getstudies', 'UsersController@getUserStudies');
Route::get('api/user/gettasks', 'UsersController@getUserTasks');
Route::get('api/user/getdiss', 'UsersController@getUserDiscusses');
Route::get('api/user/getkuibu', 'UsersController@getUserKuibu');
Route::get('api/user/sendmsg', 'UsersController@sendMsg');
Route::get('api/user/timeline', 'UsersController@getUsertimeline');
//

Route::get('task3/{id}', 'wellController@show');
Route::get('task/{id}', 'welController@show');
Route::get('morenote', 'welController@morenote');
Route::get('/task/{id}/edit', 'TasksController@e');
Route::get('task/{id}/learn', 'TasksController@learn2');
Route::get('task/{id}/contribute/{cid?}', 'TasksController@contribute');
Route::post('task/{id}/contribute/{cid?}', 'TasksController@contribute');
Route::post('task/{id}/update', 'TasksController@u');
Route::get('task/{id}/solve', 'TasksController@solve');
Route::post('task/{id}/solve', 'TasksController@solve');
Route::post('task/{id}/comment', 'TasksController@comment');
Route::resource('projects', 'projectsController');
//Route::resource('task', 'TasksController');

Route::get('/home', 'projectsController@newhome');
Route::get('/edittree', 'projectsController@edittree');
Route::post('/edittree', 'TasksController@moveTree');
Route::get('/explore', 'welController@first');
Route::get('/test/medalgrant', 'testController@medalgrant');
Route::get('/active/{id}', 'UsersController@active');
Route::get('/sendmail', 'UsersController@sendmail');
Route::get('/profile/{id}', 'UsersController@ucenter');


//discuss
Route::get('/reacts', 'testController@testreact');
Route::get('/q/{id}', 'testController@show');
Route::get('/q2/{id}', 'test2Controller@show');
Route::get('/q/{id}/a/{id2}', 'testController@show');
Route::get('/q/{id}/edit', 'disController@editq');
Route::get('/q/{id}/del', 'disController@deld');
Route::get('/ask/{tag?}', 'disController@ask');
Route::get('/discuss/{tag}/{type?}', 'testController@questions');
Route::get('/info/{tag}/{type?}', 'testController@questions');
Route::get('/gendis/{id?}', 'disController@create');
Route::post('/gendis/{id?}', 'disController@create');
Route::get('/replydis', 'disController@reply');
Route::post('/replydis', 'disController@reply');
Route::get('/tt/{p}', 'testController@index');
Route::get('/ff', 'testController@index2');
Route::get('/train/gayregister', 'testController@spider5');
Route::post('/train/gayregister', 'testController@spider5');
Route::get('/train/encode', 'trainController@ls');
Route::post('/train/encode', 'trainController@ls');

Route::get('/editdis/{id}', 'disController@edit');
Route::get('/deldis/{id}', 'disController@del');
Route::get('/updis/{id}', 'disController@up');
Route::post('/editdis/{id}', 'disController@edit');
Route::post('/api/comment', 'comController@comment');
Route::get('/api/comment', 'comController@comment');


Route::get('/u/{id?}', 'projectsController@newhome');
Route::get('/u/{id}/log', 'projectsController@log');
Route::get('/u/{id}/nlog', 'projectsController@nlog');
Route::get('/train/admin', 'projectsController@admin');
Route::post('/train/admin', 'projectsController@admin');

Route::get('/train/admin2', 'projectsController@admin2');
Route::post('/train/admin2', 'projectsController@admin2');

Route::get('/train/secret', 'welController@agent');
Route::get('/train/mysql', 'trainController@mysql');
Route::get('/upload', function () {
    return View::make('projects.upload');
});
Route::post('/upload', 'projectsController@upload');
//
//judge

Route::get('/judge/status', 'judgeController@status');
Route::get('/judge/detail/{id}', 'judgeController@detail');
Route::get('/person/{id}', 'testController@person');
//
Route::get('/showimage', 'projectsController@showimage');
Route::post('/deleteimage', 'projectsController@deleteimage');
Route::get('/imglib', 'projectsController@imagehome');
Route::post('/imglib', 'projectsController@imagehome');
// Authentication routes...
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::post('auth/jlogin', 'Auth\AuthController@jsonLogin');
Route::get('auth/logout', 'Auth\AuthController@getLogout');

// Registration routes...
Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register', 'Auth\AuthController@postRegister');
// Password reset link request routes...
Route::get('password/email', 'Auth\PasswordController@getEmail');
Route::post('password/email', 'Auth\PasswordController@postEmail');

// Password reset routes...
Route::get('password/reset/{token}', 'Auth\PasswordController@getReset');
Route::post('password/reset', 'Auth\PasswordController@postReset');


Route::post('/firstsolve', 'welController@fs');
Route::get('/firstsolve', 'welController@fs');

//Tag admin
Route::get('/tag', 'TagController@index');
Route::post('/tag', 'TagController@create');
Route::post('/tag/{id}', 'TagController@update');
Route::get('/tag/{id}/delete', 'TagController@delete');

//Skill
Route::get('/skill/{id}', 'SkillController@show');

//contest
Route::get('/contests/detail', 'contestController@detail');
Route::get('/contests/award', 'contestController@award');
Route::get('/contests/rank', 'contestController@rank');
Route::get('/contests/discuss', 'contestController@discuss');


//review
Route::get('/review/approve/{comment_id}/{type}', 'ReviewController@approve');
Route::get('/review/skip/{comment_id}/{type}', 'ReviewController@skip');

Route::get('/review/{dis_id}/{comment_id}/{type}', 'ReviewController@show');

Route::get('/review/study', 'ReviewController@randomStudy');
Route::get('/review/comment', 'ReviewController@randomNormalComment');
Route::get('/review/delete', 'ReviewController@randomDeleteVote');
Route::get('/review/pick', 'ReviewController@randomPickVote');
Route::get('/review/index', 'ReviewController@index');

Route::get('/vote/delete/{action}/{comment_id}/{type}', 'ReviewController@voteDeleteComment');
Route::get('/vote/pick/{action}/{comment_id}/{type}', 'ReviewController@voteJingHuaComment');

Route::get('/privilege/promotion', 'PrivilegeController@promotion');

//topic
Route::get('/topic/index', 'TopicController@index');

//resume
Route::get('/resume', 'resumeController@index');
Route::get('/resume/preview/{id?}', 'resumeController@preview');
Route::post('/resume/save_avatar_url', 'resumeController@save_avatar_url');
Route::post('/resume/save_resume', 'resumeController@save_resume');
Route::post('/resume/save_expect', 'resumeController@save_expect');
Route::post('/resume/save_edu', 'resumeController@save_edu');
Route::post('/resume/update_edu', 'resumeController@update_edu');
Route::post('/resume/del_edu', 'resumeController@del_edu');
Route::post('/resume/save_work', 'resumeController@save_work');
Route::post('/resume/update_work', 'resumeController@update_work');
Route::post('/resume/del_work', 'resumeController@del_work');

//invitation
Route::get('/invitation', 'invitationController@index');
Route::post('/invitation/save_attachment', 'invitationController@save_attachment');
Route::post('/invitation/save_invitation', 'invitationController@save_invitation');
Route::post('/invitation/save_touch', 'invitationController@save_touch');

//techlead view
Route::get('/techlead', 'techleadController@index');

//talent view
Route::get('/talent', 'talentController@index');
Route::get('/talent/test', 'talentController@test');
Route::post('/talent/test', 'talentController@test');
Route::get('/talent/create', 'talentController@create');
Route::get('/talent/invit', 'talentController@invit');
Route::get('/talent/interview', 'talentController@interview');
Route::get('/talent/result', 'talentController@result');
Route::get('/talent/invitdata', 'talentController@invitdata');
Route::get('/talent/acc', 'talentController@acc');
Route::get('/talent/info', 'talentController@info');
Route::get('/talent/getinfo', 'talentController@getinfo');
Route::post('/talent/commit_invit', 'talentController@commit_invit');

//talent admin
Route::get('/talent/admin', 'talentController@admin');
Route::post('/talent/search_com', 'talentController@search_com');
Route::post('/talent/admin/send_invit', 'talentController@send_invit');
Route::post('/talent/admin/send_invittime', 'talentController@send_invittime');
Route::post('/talent/admin/send_offer', 'talentController@send_offer');
Route::post('/talent/admin/notpass_offer', 'talentController@notpass_offer');
Route::post('/talent/admin/end_invit', 'talentController@end_invit');

//resume
Route::get('/talent/resume', 'resumeController@index');
Route::get('/talent/preview/{id?}', 'resumeController@preview');


//react
Route::get('/react/profile/{id?}', 'rPersonController@index');
Route::get('/react/profile/solve/{id?}', 'rPersonController@solve');
Route::get('/react/profile/discuss/{id?}', 'rPersonController@discuss');
Route::get('/react/profile/comment/{id?}', 'rPersonController@comment');
Route::get('/react/discuss/{tag}/{type?}', 'rPersonController@questions');
Route::get('/react/rank/{page?}', 'rPersonController@rank');
Route::get('/react/task/{id}', 'rPersonController@task');
Route::get('/react/task/{id}/comment', 'rPersonController@taskcomment');
Route::post('/react/task/{id}/comment/save', 'rPersonController@postcomment');
Route::post('/react/comment/del', 'rPersonController@delcomment');
Route::post('/react/vote', 'TasksController@vote2');
Route::get('/react/task/{id}/comment/save', 'rPersonController@postcomment');
Route::get('/react/q/{id}', 'rPersonController@qshow');
Route::post('/react/reply', 'rPersonController@reply');
Route::get('/react/reply', 'rPersonController@reply');
//
